<link href="static/style/main.css" rel="stylesheet" type="text/css" />
<link href="static/style/send.css" rel="stylesheet" type="text/css" />
<style type="text/css">
    body,html{height: 100%;}
    #send{background-color: #fff;width:100%;}
    table{border-collapse: separate;border-spacing:6px;height:100%;}
    body, tbody, tr, td{vertical-align: top;}
    .msgBox{width: inherit;}
    .menu{line-height: 25px;}
    .u-btn {
            display: inline-block;
            padding: 5px 12px;
            margin-bottom: 0;
            font-size: 14px;
            font-weight: normal;
            line-height: 1.428571429;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            cursor: pointer;
            background-image: none;
            border: 1px solid transparent;
            border-radius: 4px;
            color: #ffffff;
            background-color: #5cb85c;
            border-color: #4cae4c;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            -o-user-select: none;
            user-select: none;
    }
    .u-btn:focus {
            outline: thin dotted;
            outline: 5px auto -webkit-focus-ring-color;
            outline-offset: -2px;
            color: #ffffff;
            background-color: #47a447;
            border-color: #398439;
    }
    .u-btn:hover, .u-btn:focus {
            color: #333333;
            text-decoration: none;
            color: #ffffff;
            background-color: #47a447;
            border-color: #398439;
    }
    .u-send input, .u-send textarea {
	border: none;
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
	box-shadow: none;
	-webkit-transition: none;
	-moz-transition: none;
	-o-transition: none;
	transition: none;
	border-radius: 0;
	color: #999;
	width: 560px;
    }
    .u-send textarea:focus, .u-send input[type="text"]:focus {
            border-bottom: 1px dotted #ddd;
            outline: 0;
            outline: thin dotted \9;
            /* IE6-9 */
            -webkit-box-shadow: none;
            -moz-box-shadow: none;
            box-shadow: none;
            color: #666;
    }
    .u-send input {
            border-bottom: 1px dotted #eee;
            margin: 0 auto;
            display: block;
            padding: 5px 0;
    }

    /*通用弹出对话框样式*/
    .dialog_wrapper {
            display: block;
    }
    .dialog_body {
            background: #fff;
            padding: 0;
            width: 100%;
            float: left;
            padding-bottom: 20px;
    }
    .dialog_head {
    }
    .dialog_title {
            color: #666;
            font-size: 14px;
            font-weight: 500;
            padding: 0 10px 0 15px;
            display: block;
            line-height: 38px;
            background: #fff url(../../static/image/dialog/dialog_title_bg.gif?20140116) repeat-x;
            cursor: move;
    }
    .dialog_title_icon {
            display: block;
            clear: both;
            height: 38px;
    }
    .dialog_close_button {
            display: block;
            width: 15px;
            height: 15px;
            background: url(../../static/image/dialog/dialog_close_bg.gif?20140116) 0 0px;
            position: absolute;
            top: 11px;
            right: 10px;
    }
    .dialog_content {
            background: #fff;
    }
    .dialog_content .topic_new_add .sendBox .sendInsert {
            _position: absolute;
            _top: 150px;
            _left: -10px;
    }
    .dialog_content .topic_new_add .sendBox .sendSubmit {
            _padding-top: 40px;
    }
    .dialog_loading {
            text-align: center;
            width: 300px;
    }
    .dialog_loading_text {
            padding: 0px;
            padding-top: 20px;
            padding-left: 10px;
            width: 220px;
            font-style: italic;
            margin: 15px auto 5px auto;
            text-align: left;
            font-size: 15px;
            background: transparent url(../../static/image/loading.gif?20140116) no-repeat center top;
    }
    .dialog_message_body {
            padding: 15px 5px;
    }
    .dialog_message_contents {
            margin: 0px 10px;
            padding-left: 70px;
            padding-top: 15px;
            padding-bottom: 20px;
            font-size: 14px;
            font-weight: 600;
            color: #555;
    }
    .dialog_message_notice, .dialog_message_warning, .dialog_message_confirm {
            background: url(../../static/image/alert.png?20140116) no-repeat 10px top;
    }
    .dialog_buttons_bar {
            text-align: center;
            margin-top: 20px;
    }
    .dialog_buttons_bar input {
            margin: 0px 5px;
    }
    .dialog_has_title {
            background: #555;
    }
    .dialog_has_title .dialog_body {
            background: #fff;
            bottom: 3px;
            right: 3px;
            padding: 10px;
            border: 4px solid #dadada;
            color: #666;
    }
    .dialog_has_title .dialog_head {
            background: url(../../static/image/dialog/login_h1.gif?20140116);
            height: 30px;
    }
    .dialog_has_title .dialog_title {
            color: #666;
            font-size: 16px;
            font-weight: bold;
            background: #fff url(../../static/image/dialog/linebox_h1_span.gif?20140116) no-repeat left 3px;
            padding: 4px 10px 5px 15px;
            display: block;
            float: left;
    }
    .dialog_has_title .dialog_close_button {
            position: absolute;
            top: 10px;
            _top: 14px;
            right: 10px;
            background: #fff url(../../static/image/dialog/dialog_close_button.gif?20140116) no-repeat right bottom;
            width: 21px;
            height: 21px;
            padding-right: 10px;
            overflow: hidden;
            cursor: pointer;
    }
    .dialog_has_title .dialog_loading {
            text-align: center;
    }
    .dialog_has_title .dialog_loading_text {
            padding: 0px;
            padding-top: 20px;
            padding-left: 10px;
            width: 220px;
            font-style: italic;
            margin: 15px auto 5px auto;
            text-align: left;
            font-size: 15px;
            background: transparent url(../../static/image/loading.gif?20140116) no-repeat center top;
    }
    .dialog_has_title .dialog_message_body {
            margin: 15px 5px 5px 5px;
    }
    .dialog_has_title .dialog_message_contents {
            margin: 0px 10px;
            padding-left: 45px;
            padding-top: 5px;
            padding-bottom: 20px;
    }
    .dialog_has_title .dialog_message_notice {
            background: transparent url(../../static/image/dialog/message_notice.gif?20140116) no-repeat left top;
    }
    .dialog_has_title .dialog_message_warning {
            background: transparent url(../../static/image/dialog/message_warning.gif?20140116) no-repeat left top;
    }
    .dialog_has_title .dialog_message_confirm {
            background: transparent url(../../static/image/dialog/message_confirm.gif?20140116) no-repeat left top;
    }
    .dialog_has_title .dialog_buttons_bar {
            text-align: center;
            margin-top: 5px;
    }
    .dialog_has_title .dialog_buttons_bar input {
            margin: 0px 5px;
    }
    .dialog_cl {
            clear: both;
    }
    #dseccode_tips {
            width: 22px;
            display: inline;
            margin: 5px 0 0 0;
    }
    #dseccode_tips img {
            width: 16px;
            height: 16px;
            overflow: hidden;
        vertical-align: middle;
    }
    .tableborder td{height: inherit;}
    .ke-iframe{width:100%;}
</style>
<div id="send" class="mt10">
    <div class="sendBox">

        <div class="sendTitle">

            <ul class="txtNum">
                <!--{if $this->Config[topic_input_length]>0}-->
                <li>还可以输入</li><li style="width:auto"><span id="wordCheck" style='font-size:20px;'>{conf topic_input_length}</span></li><li style="width:14px;">字</li>
                <!--{/if}-->
            </ul>
        </div>

        <div class="sendInput" style="display:block">
            <script type="text/javascript">
                var __I_ALREADY_VALUE__ = '';
                var __ALERT__ = '';
                var __CONTENTID__ = 'i_already';
            </script>
            <script type="text/javascript" charset="utf-8" src="static/js/kind/kindeditor.js"></script>
            <script type="text/javascript">
                $(function(){
                    var t_type = $('input[name=topic_type]').val();
                    t_type = ('undefined' == typeof (t_type) || t_type == '') ? '0' : t_type;
                    if(t_type == '1' || t_type == '2'){
                        $(".sendBox").css('width','100%');
                        $(".sendTitle").css('width','100%');
                        $(".sendInput").css('width','100%');
                        $("textarea").css('width','100%');
                        $("textarea").css('height','640');
                        $(".mleft").hide();
                        KE.show({
                        id : 'i_already',
                        resizeMode : 1
                        });
                    }
                })
            
            </script>
            <div class="u-send">
                <input type="text" id="t_i_already" name="title" maxlength="25"  value="" placeholder="这里输入的文字将成为标题" >
                <input type="text" id="d_i_already" name="describe" maxlength="25"  value="" placeholder="这里输入的文字将成为概要">
                <textarea  name="content" id="i_already" onkeyup="javascript:checkWord('{conf topic_input_length}', 'i_already', 'wordCheck')" onkeydown="ctrlEnter(event, 'publishSubmit')">{$i_already_value}</textarea>
            </div>
            <input name="topic_type" type="hidden" id="topic_type" value="" />
            <input name="totid" type="hidden" id="totid" value="" />
            <input name="touid" type="hidden" id="touid" value="" />
            <input name="item" type="hidden" id="mapp_item" value="" />
            <input name="item_id" type="hidden" id="mapp_item_id" value="" />
            <input name="xiami_id" type="hidden" id="xiami_id" value="" />
            <input type="hidden" id="cverify" name="cverify" value="">
        </div>

        <div class="sendInsert sendInsertfocus">
            <script type="text/javascript">
                $(function(){
                    $(".menu_title").click(function(){
                        var check_uid = $('#check_PublishBox_uid').val();
                        var uid = ('undefined' == typeof (check_uid) || check_uid == '') ? '0' : check_uid;
                        if(uid < 1){
                            show_message('请输入选择用户', 1, '提示', 'msgBox', 'msg_alert');
                            return false;
                        }
                        $("inpupt[name='uid']").val(uid);
                        $(".menu_content,.menu_c_content").hide();
                        var id = $(this).attr("currid");
                        if (id){
                            $("#" + id).show();
                        }
                    }); //一级菜单
                    $(".menu_c_title").click(function(){
                        $(".menu_c_content").hide();
                        var id = $(this).attr("currid");
                        if (id){//二级菜单
                            if (id == "showattachmenu"){
                                MessageBox('warning', '您没有上传附件的操作权限！');
                            } else{
                                $("#" + id).show();
                            }                //附件权限判断
                        }
                    });
                    $(".menu_close").click(function(){
                        var id = $(this).attr("currid");
                        if (id){
                            $("#" + id).hide();
                        }
                    }); //关闭按钮
                });
                function setTab(name, cursel, n, t){
                    for (i = 1; i <= n; i++){
                    var menu = document.getElementById(name + i); var con = document.getElementById("con_" + name + "_" + i);
                            menu.className = i == cursel?"vhover":""; con.style.display = i == cursel?"block":"none";
                            if (i != cursel && t){$("#con_" + name + "_" + i + " div").remove(); }
                    }
                }
            </script>

            <div class="mleft">


                <!--{if $this->Config['face_enable']}-->
                <div class="menu">
                    <div class="menu_bq" id="editface" ><b class="menu_bqb_c menu_title" currid="showface"><a href="javascript:void(0);" title="点击插入表情，让内容更生动" onclick="topic_face('showface', 'i_already', 'topic_face'); return false;" style="color:#666;">表情</a></b>    
                        <div id="showface" class="showface menu_content"></div>     
                    </div>
                </div>
                <!--{/if}-->

                <!--{if $this->Config['image_enable']}-->
                <!-- 图片区块 开始 -->
                <!--{eval $handle_key = 'showuploadimage'.$h_key;}-->
                <div class="menu">
                    <div class="menu_tq" ><b class="menu_tqb_c menu_title" currid="showuploadimage" title="可实现图文混排">图片</b>
                        <div class="menu_tqb menu_content" id="showuploadimage">       
                            <span class="arrow-up"></span>   
                            <span class="arrow-up-in"></span>

                            <div class="menu_tqbox">  
                                <i class="menu_tqb_c1 menu_close" currid="showuploadimage"></i>	          
                                {template "imgupload"}
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 图片区块 结束 -->
                <!--{/if}-->


                <!--{if $this->Config['word_type_enable']}-->
                <div class="menu">
                    <div class="menu_a">
                        <b class="menu_a_c menu_title" currid="showstylemenu"><a href="javascript:void(0);" title="给文字加上特效" style="color:#666;">格式</a></b>
                        <div class="pull menu_content" style="display:none;" id="showstylemenu">
                            <span class="arrow-up"></span>   
                            <span class="arrow-up-in"></span>
                            <sub class="menu_a_c1 menu_close" currid="showstylemenu"></sub>
                            <div class="menu_hb">
                                <span onclick="setFont('b'); return false;" class="menu_hbb_c" title="先在输入框中选择要加粗的文字">粗体</span>
                            </div>
                            <div class="menu_underline">
                                <span onclick="setFont('u'); return false;" class="menu_underline_c" title="先在输入框中选择要加下划线的文字">下划线</span>
                            </div>
                            <div class="menu_hc">
                                <span onclick="getColorMenu(); return false;" class="menu_hcb_c menu_c_title" currid="color_menu" title="先在输入框中选择要加颜色的文字">颜色</span>
                                <sub class="menu_color_c1 menu_close" currid="color_menu"></sub>
                                <div class="menu_c_b menu_c_content" id="color_menu"></div>
                            </div>
                            
                            
                            <!--{hook/global_publish_menu_style}-->
                        </div>
                    </div>
                </div>    

                <div class="menu">
                    <div class="menu_m">
                        <b class="menu_m_c menu_title" currid="showmoremenu"><a href="javascript:void(0);" style="color:#666;">更多</a></b>
                        <div class="pull_down menu_content" id="showmoremenu" style="display:none;">
                            <span class="arrow-up"></span>   
                            <span class="arrow-up-in"></span>
                            <sub class="menu_m_c1 menu_close" currid="showmoremenu"></sub>


                            <!--{if $this->Config['video_enable']}-->

                            <div class="menu_sp"><b class="menu_spb_c menu_c_title" currid="upload_ajax_video" title="支持新浪、优酷、搜狐、酷6、土豆视频的站内播放">视频</b>
                                <div class="menu_spb menu_c_content" id="upload_ajax_video">
                                    <span class="arrow-up"></span>   
                                    <span class="arrow-up-in"></span>
                                    <div class="menu_tb" style="width:300px;">
                                        <span style="float:left; padding-left:10px; color:#666; width:270px;">支持如下视频的站内播放</span><div class="menu_spb_c1 menu_close" currid="upload_ajax_video"></div></div>
                                    <p class="menu_p"><a href="http://www.youku.com/" rel="nofollow" target="_blank">优酷</a>、<a href="http://v.blog.sohu.com/" rel="nofollow" target="_blank">搜狐</a>、<a href="http://www.ku6.com/" rel="nofollow" target="_blank">酷6</a>、<a href="http://www.tudou.com/" rel="nofollow" target="_blank">土豆</a><!--{loop $GLOBALS[_J][config][video_parse_extract_list] $vpe}-->、<a href="{$vpe[url]}" rel="nofollow" target="_blank">{$vpe[name]}</a><!--{/loop}--><br>请在浏览器中复制视频播放页的网址</p>
                                    <div id="upload_video_list" class="menu_p" style="display:none;">
                                        <span id="return_ajax_video_title"></span>
                                        <span><img id="video_img" width="130" /></span>
                                        <p>
                                            <input id="videoid" type="hidden" name="video_id" />
                                            <span><a href="" onclick="DelVideo('videoid', 'video_ajax'); return false;" title="删除视频">删除视频</a></span>
                                        </p>
                                    </div>
                                    <div id="add_video" class="menu_p" style=" margin-bottom:6px; padding-top:0">
                                        <iframe id="upload_video_frame" name="upload_video_frame" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
                                        <form action="ajax.php?mod=topic&code=dovideo" method="post" enctype="multipart/form-data" name="upload_video" id="upload_video" target="upload_video_frame">
                                            <input name="url" type="text" id="url" class="sc_r_t_a" style=" width:210px; display:inline; padding:2px;"/>
                                            <input name="uid" type="hidden" />
                                            <input type="submit" name="Submit" value="提 交" class="u-btn" />
                                        </form>
                                    </div>
                                </div>
                            </div>
                            <!--{/if}-->

                            
                            <!--{hook/global_publish_menu_more}-->            
                        </div>
                    </div>
                </div>
                <!--{hook/global_publish_menu}-->
                

                <!--{else}-->
                <div class="box_3ajax">
                    <!--{/if}-->
                </div>

                <div class="sendBtn">
                    
                    <input type="button" class="u-btn" id="publishSubmit" title="按Ctrl+Enter快捷发布" value="发 布"/>
                </div>
            </div>             
            <!--{hook/global_publish_bottom}-->
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#publishSubmit").bind('click',function() {
            var check_uid = $('#check_PublishBox_uid').val();
            var uid = ('undefined' == typeof (check_uid) || check_uid == '') ? '0' : check_uid;
            if(uid < 1){
                show_message('请输入选择用户', 1, '提示', 'msgBox', 'msg_alert');
                return false;
            }
            var PublishBox_type = $('#PublishBox_type').val();
            var topic_type = 'undefined' == typeof (PublishBox_type) ? '0' : PublishBox_type;
            var title = $("input[name=title]").val();
            var describe = $("input[name=describe]").val();
            if(topic_type == '1' || topic_type == '2'){
                if(title == '' || describe == ''){
                    MessageBox('notice', "标题和简介不可为空", '提示');
                    return false;
                }
            }
            if(topic_type == '1'){
                if (document.getElementById('stime').value == '') {
                    MessageBox('notice', "请输入开始时间", '提示');
                    return false;
                }
                if (document.getElementById('etime').value == '') {
                    MessageBox('notice', "请输入结束时间", '提示');
                    return false;
                }
                if (document.getElementById('etime').value <= document.getElementById('stime').value) {
                    MessageBox('notice', "结束时间必须大于开始时间", '提示');
                    return false;
                }
            }
            publishSubmit('publishSubmit','u-btn','i_already','totid','{$type}','topic_type','','',$('#mapp_item').val(),
            $('#mapp_item_id').val(),$('#xiami_id').val(),$('#touid').val(),0,$('#cverify').val());
            return false;
    });
    $("#upload_video").submit(function() {
        var check_uid = $('#check_PublishBox_uid').val();
	var uid ='undefined'==typeof(check_uid)?'0':check_uid;
        $("input[name=uid]").val(uid);
        return true;
    });
</script>